home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_casm / snip9611.zip / PRTSCRN.C < prev    next >
C/C++ Source or Header  |  1996-11-24  |  1KB  |  53 lines

  1. /* +++Date last modified: 08-Sep-1996 */
  2.  
  3. /*
  4. **  PRTSC.C - Access the BIOS print screen function
  5. **
  6. **  public domain demo by Bob Stout
  7. */
  8.  
  9. #include <dos.h>
  10. #include "extkword.h"
  11. #include "sniprint.h"
  12.  
  13. /*
  14. **  Get screen printing status
  15. **
  16. **  0 - Ready
  17. **  1 - Screen printing in process
  18. **  2 - Error occurred last time
  19. */
  20.  
  21. int PrtScrnStat(void)
  22. {
  23.       return ((int)*((char FAR *)(0x00500000L)));
  24. }
  25.  
  26. /*
  27. **  Print the current screen
  28. */
  29.  
  30. int PrtScrn(void)
  31. {
  32.  
  33.       union REGS regs;                    /* Dummy for use by int86()  */
  34.  
  35.       if (1 == PrtScrnStat())             /* Can we print now?          */
  36.             return -1;                    /* Nope, return with error    */
  37.       int86(5, ®s, ®s);            /* Issue Int 5                */
  38.       return 0;
  39. }
  40.  
  41. #ifdef TEST
  42.  
  43. #include <stdio.h>
  44.  
  45. main()
  46. {
  47.       printf("PrtScrn() returned %d\n", PrtScrn());
  48.       printf("PrtScrnStat() returned %d\n", PrtScrnStat());
  49.       return 0;
  50. }
  51.  
  52. #endif /* TEST */
  53.